package com.lx.yygh.hosp.controller;

import com.lx.yygh.common.result.Result;
import com.lx.yygh.hosp.service.DepartmentService;
import com.lx.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author c先生
 * @date 2022年10月18日 下午 1:45:03
 * @describe
 */
@Api(tags = "科室模块")
@RestController
@RequestMapping("/admin/hosp/department")
//@CrossOrigin//支持跨域请求
public class DepartmentController {

    @Resource
    private DepartmentService departmentService;

    @GetMapping("/getDeptByHoscode/{hoscode}")
    public Result getDeptByHoscode(String hoscode){
        List<DepartmentVo> deptDataTree = departmentService.findDeptDataTree(hoscode);
        return Result.ok(deptDataTree);
    }
}
